<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>商品浏览 - 二手平台</title>
    <link rel="stylesheet" href="css/style.css">
    <style>
        body {
            font-family: "Segoe UI", sans-serif;
            background-color: #f4f6f8;
            margin: 0;
            padding: 20px;
        }
        .product-list {
            max-width: 1200px;
            margin: auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
        }
        .product-card {
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.05);
            padding: 15px;
            display: flex;
            flex-direction: column;
            transition: transform 0.2s;
        }
        .product-card:hover {
            transform: translateY(-5px);
        }
        .product-image {
            width: 100%;
            height: 180px;
            object-fit: cover;
            border-radius: 6px;
        }
        .product-name {
            font-size: 18px;
            font-weight: bold;
            margin: 10px 0 5px;
        }
        .product-price {
            color: #e91e63;
            font-size: 16px;
            margin-bottom: 10px;
        }
        .product-desc {
            font-size: 14px;
            color: #666;
            flex-grow: 1;
        }
        .detail-button {
            margin-top: 15px;
            text-align: center;
            background-color: #007bff;
            color: white;
            padding: 8px 12px;
            text-decoration: none;
            border-radius: 4px;
            display: inline-block;
        }
        .detail-button:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>
<nav>
    <a href="/index.html">首页</a>
    <a href="/products.html">浏览商品</a>
    <a href="/publish.html">发布商品</a>
    <a href="/dashboard.html">我的商品</a>
    <a href="#" id="logoutBtn">退出登录</a>
</nav>
<div class="container">
    <h2>商品列表</h2>
    <div id="productList"></div>
</div>
<script src="js/api.js"></script>
<script src="js/products.js"></script>
<div class="product-card">
    <img src="images/ly.png" class="product-image" alt="商品图片">
    <div class="product-name">无线蓝牙耳机</div>
    <div class="product-price">￥199.00</div>
    <div class="product-desc">高清音质，主动降噪，续航长达20小时。</div>
    <a href="#" class="detail-button">查看详情</a>
</div>

<!-- 商品2 -->
<div class="product-card">
    <img src="images/sh.png" class="product-image" alt="商品图片">
    <div class="product-name">智能手环</div>
    <div class="product-price">￥149.00</div>
    <div class="product-desc">健康监测，消息提醒，IP67防水。</div>
    <a href="#" class="detail-button">查看详情</a>
</div>

<!-- 商品3 -->
<div class="product-card">
    <img src="images/bx.png" class="product-image" alt="商品图片">
    <div class="product-name">便携榨汁机</div>
    <div class="product-price">￥89.00</div>
    <div class="product-desc">一键启动，USB充电，居家旅行必备。</div>
    <a href="#" class="detail-button">查看详情</a>
</div>

<!-- 商品4 -->
<div class="product-card">
    <img src="images/xm.png" class="product-image" alt="商品图片">
    <div class="product-name">小米电风扇</div>
    <div class="product-price">￥269.00</div>
    <div class="product-desc">静音节能，智能遥控，三档可调。</div>
    <a href="#" class="detail-button">查看详情</a>
</div>
</div>
</body>
</html>
